package com.example.mapper;

import com.example.entity.User;
import com.example.entity.Volunteer;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ASUS
 */
public interface UserMapper {
    void insert(User user);


    @Select("select * from user where username = #{username}")
    User selectByUsername(String username);

    @Select("select*from user")
    List<User> selectAll();

    @Select("select*from user where name like concat('%',#{name},'%')")
    List<User> selectByName(String name);

    @Delete("delete from user where id = #{id}")
    void deleteById(Integer id);

    void updateById(User user);

    @Select("select*from user where id = #{id}")
    User selectById(Integer id);


}
